<%--
   Document   : registroHorario
   Created on : 04/06/2010, 11:39:31 AM
   Author     : lkina
--%>
<%@ taglib prefix="s" uri="/struts-tags"%>
<%@page contentType="text/html" pageEncoding="UTF-8"%>
<!DOCTYPE HTML PUBLIC "-//W3C//DTD HTML 4.01 Transitional//EN"
    "http://www.w3.org/TR/html4/loose.dtd">
<%@ page import="java.util.*, pe.edu.upc.dew.profesoresparticulares.model.*"%>
<%List<Map> menus = (List<Map>) request.getSession().getAttribute("MENU");%>
<%List<Curso> cursos = (List<Curso>) request.getAttribute("CURSOS");%>
<%List<Horario> horarios = (List<Horario>) request.getAttribute("HORARIO");%>
<html xmlns="http://www.w3.org/1999/xhtml">
    <head>
        <title>Bienvenido | Profesores Particulares</title>
        <meta http-equiv="content-type" content="application/xhtml+xml; charset=UTF-8" />
        <meta name="author" content="fullahead.org" />
        <meta name="keywords" content="XHTML, CSS, template, FullAhead" />
        <meta name="description" content="A valid, XHTML 1.0 template" />
        <meta name="robots" content="index, follow, noarchive" />
        <meta name="googlebot" content="noarchive" />

        <link rel="stylesheet" type="text/css" href="css/html.css" media="screen, projection, tv " />
        <link rel="stylesheet" type="text/css" href="css/layout.css" media="screen, projection, tv" />
        <link rel="stylesheet" type="text/css" href="css/print.css" media="print" />

    </head>

    <body>
        <!-- #wrapper: centers the content and sets the width -->
        <div id="wrapper">
            <!-- #content: applies the white, dropshadow background -->
            <div id="content">
                <div id="header">
                    <h1><span class="big darkBrown">P</span>rofesores <span class="big darkBrown">P</span>articulares</h1>
                    <h2><span class="highlight">Reserva tu curso y profesor favorito en un par de clicks.</span></h2>
                </div>

                <ul id="menu" class="five">
                    <%for (int i = 0; i < menus.size(); i++) {%>
                    <li><a href="<%=request.getContextPath()%>/<%=((Map) menus.get(i)).get("url")%>" title="" class="here">
                            <span class="big"></span>
                            <%=((Map) menus.get(i)).get("descripcion")%>
                        </a></li>

                    <% }%>
                </ul>
                <!-- #page: holds all page content, as well as footer -->
                <div id="page">


                    <s:form action="registrarHorario">
                        <s:select name="curso" list="cursos" listKey="codCurso" listValue="nomCurso" label="Curso"/>
                        <s:textfield label="Fecha"name="fecha" />
                        <s:textfield label="Lugar"name="lugar" />
                        <s:textfield label="Costo"name="costo" />
                        <s:select name="hora" list="horaList" listKey="clave" listValue="descripcion" label="Hora Inicio"/>
                        <s:select name="horas" list="horasList" listKey="clave" listValue="descripcion" label="Horas"/>
                        <s:submit value="Grabar"/>
                        <s:actionerror />
                        <s:fielderror />
                    </s:form>

                    <%if (horarios != null && horarios.size() > 0) {%>

                    <table border="1" cellspacing="1" cellpadding="1">
                        <thead>
                        <th>Curso</th>
                        <th>Fecha</th>
                        <th>Lugar</th>
                        <th>Costo</th>
                        <th>Horas</th>
                        </thead>
                        <tbody>
                            <%for (Horario horario : horarios) {%>
                            <tr id="patron">
                                <td id="curso"><%=horario.getNomCurso()%></td>
                                <td id="fecha"><%=horario.getFecha()%></td>
                                <td id="lugar"><%=horario.getLugar()%></td>
                                <td id="costo"><%=horario.getCosto()%></td>
                                <td id="horas"><%=horario.getDescHora()%></td>
                            </tr>
                            <%}%>
                        </tbody>
                    </table>
                    <%}%>
                    <p class="footer">
                        Design by <a href="http://fullahead.org" title="Visit FullAhead">FullAhead</a>.  Valid CSS &amp; XHTML with no rights reserved.
                    </p>

                </div>

            </div>

        </div>

    </body>

</html>